package cn.portx.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bstek.bdf3.dorado.jpa.annotation.Generator;
import com.bstek.dorado.annotation.PropertyDef;

import cn.portx.annotation.ChineseField;
import cn.portx.policy.ChineseToCodeGeneratorPolicy;
import cn.portx.policy.CreateUserPolicy;
import cn.portx.policy.CreatedDatePolicy;
import cn.portx.policy.IdGeneratorPolicy;

/**
 * Model class of 船公司.
 * 
 * @author generated by ERMaster
 * @version $Id$
 */
@Entity
@Table(name = "T_SHIPPING_COMPANY")
public class ShippingCompany extends BaseEntity {

	/** serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** 船公司. */
	@Column(name = "NAME_", length = 100)
	@PropertyDef(label = "船公司", description = "船公司:船公司")
	private String name;

	/** 船公司编号. */
	@Column(name = "CODE_", length = 60)
	@ChineseField("name")
	@Generator(policy = ChineseToCodeGeneratorPolicy.class)
	@PropertyDef(label = "船公司编号", description = "船公司编号:船公司编号")
	private String code;

	/** 大柜打单费. */
	@Column(name = "DGDDF_", precision = 10, scale = 2)
	@PropertyDef(label = "大柜打单费", description = "大柜打单费:大柜打单费")
	private Double dgddf;

	/** 小柜打单费. */
	@Column(name = "XGDDF_", precision = 10, scale = 2)
	@PropertyDef(label = "小柜打单费", description = "小柜打单费:小柜打单费")
	private Double xgddf;

	/** 联系人. */
	@Column(name = "CONTACT_", length = 20)
	@PropertyDef(label = "联系人", description = "联系人:联系人")
	private String contact;

	/** 联系电话. */
	@Column(name = "TEL_", length = 20)
	@PropertyDef(label = "联系电话", description = "联系电话:联系电话")
	private String tel;

	/** 进口免滞箱费天数. */
	@Column(name = "JKMZXFTX_", precision = 2, scale = 0)
	@PropertyDef(label = "进口免滞箱费天数", description = "进口免滞箱费天数:进口免滞箱费天数")
	private Integer jkmzxfts;

	/** 出口免滞箱费天数. */
	@Column(name = "CKMZXFTS_", precision = 2, scale = 0)
	@PropertyDef(label = "出口免滞箱费天数", description = "出口免滞箱费天数:出口免滞箱费天数")
	private Integer ckmzxfts;

	@Transient
	private List<Vessel> vessels;

	/**
	 * Constructor.
	 */
	public ShippingCompany() {
	}

	/**
	 * Set the 船公司.
	 * 
	 * @param name
	 *            船公司
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get the 船公司.
	 * 
	 * @return 船公司
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Set the 船公司编号.
	 * 
	 * @param code
	 *            船公司编号
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * Get the 船公司编号.
	 * 
	 * @return 船公司编号
	 */
	public String getCode() {
		return this.code;
	}

	/**
	 * Set the 大柜打单费.
	 * 
	 * @param dgddf
	 *            大柜打单费
	 */
	public void setDgddf(Double dgddf) {
		this.dgddf = dgddf;
	}

	/**
	 * Get the 大柜打单费.
	 * 
	 * @return 大柜打单费
	 */
	public Double getDgddf() {
		return this.dgddf;
	}

	/**
	 * Set the 小柜打单费.
	 * 
	 * @param xgddf
	 *            小柜打单费
	 */
	public void setXgddf(Double xgddf) {
		this.xgddf = xgddf;
	}

	/**
	 * Get the 小柜打单费.
	 * 
	 * @return 小柜打单费
	 */
	public Double getXgddf() {
		return this.xgddf;
	}

	/**
	 * Set the 联系人.
	 * 
	 * @param contact
	 *            联系人
	 */
	public void setContact(String contact) {
		this.contact = contact;
	}

	/**
	 * Get the 联系人.
	 * 
	 * @return 联系人
	 */
	public String getContact() {
		return this.contact;
	}

	/**
	 * Set the 联系电话.
	 * 
	 * @param tel
	 *            联系电话
	 */
	public void setTel(String tel) {
		this.tel = tel;
	}

	/**
	 * Get the 联系电话.
	 * 
	 * @return 联系电话
	 */
	public String getTel() {
		return this.tel;
	}

	/**
	 * Set the 进口免滞箱费天数.
	 * 
	 * @param jkmzxfts
	 *            进口免滞箱费天数
	 */
	public void setJkmzxfts(Integer jkmzxfts) {
		this.jkmzxfts = jkmzxfts;
	}

	/**
	 * Get the 进口免滞箱费天数.
	 * 
	 * @return 进口免滞箱费天数
	 */
	public Integer getJkmzxfts() {
		return this.jkmzxfts;
	}

	/**
	 * Set the 出口免滞箱费天数.
	 * 
	 * @param ckmzxfts
	 *            出口免滞箱费天数
	 */
	public void setCkmzxfts(Integer ckmzxfts) {
		this.ckmzxfts = ckmzxfts;
	}

	/**
	 * Get the 出口免滞箱费天数.
	 * 
	 * @return 出口免滞箱费天数
	 */
	public Integer getCkmzxfts() {
		return this.ckmzxfts;
	}

	public List<Vessel> getVessels() {
		return vessels;
	}

	public void setVessels(List<Vessel> vessels) {
		this.vessels = vessels;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
		return result;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		ShippingCompany other = (ShippingCompany) obj;
		if (this.getId() == null) {
			if (other.getId() != null) {
				return false;
			}
		} else if (!this.getId().equals(other.getId())) {
			return false;
		}
		return true;
	}

}
